package com.servlet;

import com.tools.Utils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class Delete {
    //Delete最简单，详见Insert
    public boolean delete(Integer id){
        Connection con=Utils.getConn();
        try {
            PreparedStatement pstat=con.prepareStatement("DELETE FROM students WHERE sid="+id+";");
            pstat.execute();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return true;
    }
}
